<template>
  <div id="components-popover-demo-placement">
    <div :style="{ marginLeft: `${buttonWidth}px`, whiteSpace: 'nowrap' }">
      <CloudPopover placement="topLeft" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>TL</CloudButton>
      </CloudPopover>
      <CloudPopover placement="top" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>Top</CloudButton>
      </CloudPopover>
      <CloudPopover placement="topRight" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>TR</CloudButton>
      </CloudPopover>
    </div>
    <div :style="{ width: `${buttonWidth}px`, float: 'left' }">
      <CloudPopover placement="leftTop" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>LT</CloudButton>
      </CloudPopover>
      <CloudPopover placement="left" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>Left</CloudButton>
      </CloudPopover>
      <CloudPopover placement="leftBottom" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>LB</CloudButton>
      </CloudPopover>
    </div>
    <div :style="{ width: `${buttonWidth}px`, marginLeft: `${buttonWidth * 4 + 24}px` }">
      <CloudPopover placement="rightTop" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>RT</CloudButton>
      </CloudPopover>
      <CloudPopover placement="right" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>Right</CloudButton>
      </CloudPopover>
      <CloudPopover placement="rightBottom" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>RB</CloudButton>
      </CloudPopover>
    </div>
    <div :style="{ marginLeft: `${buttonWidth}px`, clear: 'both', whiteSpace: 'nowrap' }">
      <CloudPopover placement="bottomLeft">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>BL</CloudButton>
      </CloudPopover>
      <CloudPopover placement="bottom" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>Bottom</CloudButton>
      </CloudPopover>
      <CloudPopover placement="bottomRight" title="标题">
        <template slot="content">
          <div>Content</div>
          <div>Content</div>
        </template>
        <CloudButton>BR</CloudButton>
      </CloudPopover>
    </div>
  </div>
</template>

<script>
  export default {
    title: '5.位置',
    subTitle: '位置有十二个方向。',
    data () {
      return {
        buttonWidth: 70,
      }
    },
    methods: {
    }
  }
</script>

<style lang="scss">
  #components-popover-demo-placement .ant-btn {
    width: 70px;
    text-align: center;
    padding: 0;
    margin-right: 8px;
    margin-bottom: 8px;
  }
</style>